<template>
  <div class="app-container">
    <div class="head-container">
      <div>
        <date-range-picker v-model="query.endDate" class="date-item" />
        <rrOperation />
      </div>
      <div class="btnContain">
        <el-button>下载数据</el-button>
      </div>
    </div>
    <!--表格渲染-->
    <el-table ref="table" v-loading="crud.loading" :height="height" border :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
      <el-table-column :show-overflow-tooltip="true" prop="endDate" label="日期" />
      <el-table-column :show-overflow-tooltip="true" prop="projectName" label="项目" />
      <el-table-column :show-overflow-tooltip="true" prop="settlementQuantityStr" label="结算量" />
      <el-table-column :show-overflow-tooltip="true" prop="settlementPersonalPriceStr" label="结算价格" />
      <el-table-column :show-overflow-tooltip="true" prop="settlementPlatformPriceStr" label="结算收益" />
      <el-table-column :show-overflow-tooltip="true" label="结算金额" align="center" prop="confirmedNum" />
      <el-table-column :show-overflow-tooltip="true" prop="platformIncome" label="平台收益" />
    </el-table>
    <pagination />
  </div>
</template>

<script>
import crudTotal from '@/api/total'
import CRUD, { presenter, header, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker'
import { mapGetters } from 'vuex'
export default {
  name: 'GoodsDataTotal',
  components: { rrOperation, pagination, DateRangePicker },
  cruds() {
    return CRUD({ title: '作品汇总', url: 'api/earningsSum', crudMethod: { ...crudTotal }})
  },
  mixins: [presenter(), header(), crud()],
  // 数据字典
  dicts: ['user_status'],
  data() {
    return {
      height: document.documentElement.clientHeight - 180 + 'px;'
    }
  },
  computed: {
    ...mapGetters([
      'user'
    ])
  },
  created() {
  },
  mounted: function() {
    const that = this
    window.onresize = function temp() {
      that.height = document.documentElement.clientHeight - 180 + 'px;'
    }
  },
  methods: {
  }
}
</script>

          <style rel="stylesheet/scss" lang="scss" scoped>
            .head-container {
              display: flex;
              justify-content: space-between;
              .btnContain {
                ::v-deep .el-button {
                background-color: rgba(236, 91, 91, 1);
                color: #fff;
                border: 0;
              }
              }
            }

          </style>

